package com.buss.customer.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Transient;

/***
 * 客户分类
 * @author gykl
 *
 */
@Entity
@Table(name = "customer_customerclass")
@TableGenerator(name="customerclass_pk_sequence",initialValue=1,allocationSize=1,pkColumnName="seq_col",
	pkColumnValue="customerclass_seq",valueColumnName="seq_val",table="customer_pk_sequence")
public class CustomerClass  implements Serializable{

	private static final long serialVersionUID = 3633015829633310798L;

	/**往来单位分类编码*/
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator="customerclass_pk_sequence")
	private Long id;
	
	/**单位ID*/
	@Column(length=20,nullable=false)
	private String companyId;
	
	/**分类名称*/
	@Column(length=50,nullable=false)
	private String name;

	/**分类说明*/
	@Column(length=254)
	private String intro;
	
	/**上级分类ID*/
	@Column(nullable=false)
	private Long parentId;
	
	/**直接子分类数*/
	@Column(nullable=false)
	private Integer subClasses;
	
	/**子节点信息*/
	@Transient
	private List<CustomerClass> nodes;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public Integer getSubClasses() {
		return subClasses;
	}

	public void setSubClasses(Integer subClasses) {
		this.subClasses = subClasses;
	}

	public List<CustomerClass> getNodes() {
		return nodes;
	}

	public void setNodes(List<CustomerClass> nodes) {
		this.nodes = nodes;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}
	
	
}
